
package com.eyedog.video.maincategory;

import com.eyedog.library.mvp.BasePresenter;
import com.eyedog.video.entity.CategoryEntity;
import com.eyedog.video.http.ICallback;

import java.util.List;

public class CategoryPresenter
        extends BasePresenter<constract.ICategoryView, constract.ICategoryModel> {

    public CategoryPresenter(constract.ICategoryView iCategoryView,
            constract.ICategoryModel iCategoryModel) {
        super(iCategoryView, iCategoryModel);
    }

    public void displayCategory() {
        model.loadCategories(new ICallback<List<CategoryEntity>>() {
            @Override
            public void onLoadSuccess(List<CategoryEntity> categoryEntities) {
                view.showCategories(categoryEntities);
            }

            @Override
            public void onLoadFailed(String err) {
                view.showFailedView(err);
            }
        });
    }
}
